﻿<div ng-controller="orderController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default"
                           data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">监管账户交易</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <input type="radio" name="checked" ng-checked="true" value="0"
                                           ng-model="filter.isPaid" ng-change="reflash()"> 未打款
                                    <input type="radio" name="checked" value="1" ng-model="filter.isPaid"
                                           ng-change="reflash()"> 已打款
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html"
                           class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'订单号'" sortable="'order_number'" class="text-center">{{ item.order_number
                                }}
                            </td>
                            <td data-title="'票据类型'" sortable="'bill_type_id'" class="text-center">{{ item.bill_type_name
                                }}
                            </td>
                            <td data-title="'成交金额'" sortable="'order_total_price'" class="text-right">{{
                                item.order_total_price | currency }}
                            </td>
                            <td data-title="'签收时间'" sortable="'bill_deadline_time'" class="text-center">{{
                                item.bill_deadline_time | date: 'yyyy-MM-dd' }}
                            </td>
                            <td data-title="'订单状态'" class="text-left">{{ item.bill_status_name }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="check(item)"><i class="fa fa-edit"></i> 详细
                                </button>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal fade" id="modal-check">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <ng-form name="checkForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>票据详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 票据类型：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.bill_type_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 订单类型：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.order_type_name }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 订单号码：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.order_number }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 订单状态：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.order_status_name +'->' + model.order_status_description}}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                成交金额[元]：</label>
                                            <div class="col-md-4 form-inline form-control-static">
                                                {{ model.order_total_price }} &nbsp; &nbsp;{{
                                                amountInWords(model.order_total_price) }}
                                            </div>
                                            <label class="control-label col-md-2">汇票到期日：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.bill_deadline_time | date: 'yyyy-MM-dd' }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2">汇票正面：</label>
                                            <div class="col-sm-4">
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{model.bill_front_photo_path}}" target="_blank">
                                                        <img class="jqzoom" src="{{model.bill_front_photo_path}}"
                                                             rel="{{model.bill_front_photo_path}}" alt="汇票正面未上传"/>
                                                    </a>
                                                </div>
                                            </div>
                                            <label class="control-label col-md-2">汇票背书：</label>
                                            <div class="col-sm-4">
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="model.order_endorsements[0].endorsement_path"
                                                       target="_blank">
                                                        <img class="jqzoom"
                                                             src="{{model.order_endorsements[0].endorsement_path}}"
                                                             rel="{{model.order_endorsements[0].endorsement_path}}"
                                                             alt="汇票背书未上传"/>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2">承兑机构：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.acceptor_type_name }}
                                            </div>
                                            <label class="control-label col-md-2">承兑银行：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.acceptor_name }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <h4>出票人信息</h4>
                                            <hr/>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                出票人：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.drawer_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 出票人账户：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.drawer_account_number }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                出票账户银行：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.drawer_account_bank }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 出票大额行号：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.drawer_account_bank_number }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <h4>收票人信息</h4>
                                            <hr/>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                收票人：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.receiver_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 收票人账户：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.receiver_account_number }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                收票账户银行：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.receiver_account_bank }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span>
                                                收票大额行号：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.receiver_account_bank_number }}
                                            </div>

                                        </div>
                                        <!--<div class="form-group width-full">
                                            <label class="control-label col-md-2"> 支付方式：</label>
                                            <div class="col-md-4">
                                                <select class="form-control width-200" ng-model="model.orderPayTypeId" ng-options="item.code as item.constant_name for item in orderPayTypeData" required></select>
                                            </div>
                                        </div>-->
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"> 备注信息：</label>
                                            <div class="col-md-10 form-control-static">
                                                {{ model.description }}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-sm btn-success" ng-if="model.bill_status_code==808"
                                            ng-click="save()" ng-disabled="checkForm.$invalid"><i
                                            class="fa fa-save"></i> 付款
                                    </button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i
                                            class="fa fa-share-square-o"></i> 关闭
                                    </button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

